package com.charles.video.common.core.utils;

import org.mindrot.jbcrypt.BCrypt;

/**
 * @author Charles-H
 * 
 * bcrypt加密
 */
public class BcryptUtils {
    
    // 加密
    public static String bcryptPassword(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }
    
    // 校验
    public static Boolean checkPassword(String inputPassword, String originPassword) {
        return BCrypt.checkpw(inputPassword, originPassword);
    }
    
}
